﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:s="http://schemas.microsoft.com/surface/2008"
                    xmlns:controls="clr-namespace:WinwiseARDrone.SurfaceV1Client.Controls">

    <Style TargetType="{x:Type controls:EmergencyControl}">
        <Setter Property="Height" Value="768"/>
        <Setter Property="Width" Value="1024"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:EmergencyControl}">
                    <ControlTemplate.Resources>
                        <ImageBrush x:Key="GridBackground" ImageSource="pack://application:,,,/WinwiseARDrone.SurfaceV1Client;component/Assets/EmergencyItem.png"/>
                    </ControlTemplate.Resources>
                    
                    <Canvas Height="{TemplateBinding Height}"
                            Width="{TemplateBinding Width}"
                            Background="Transparent">

                        <!-- Item de sélection-->

                        <Grid x:Name="PART_grdItem"
                              Canvas.Left="100"
                              Canvas.Top="100"
                              Visibility="Collapsed"
                              Width="185"
                              Height="175"
                              Background="{StaticResource GridBackground}"
                              RenderTransformOrigin="0.5,0.5">

                            <!-- Bouton Oui -->

                            <s:SurfaceButton x:Name="PART_btnReset"
                                             VerticalAlignment="Top"
                                             HorizontalAlignment="Left"
                                             Margin="5,45,0,0">
                                <s:SurfaceButton.Template>
                                    <ControlTemplate>
                                        <Grid Width="80"
                                              Height="80">
                                            <Image x:Name="StateImageNormal" 
                                                   Width="42"
                                                   Height="42"
                                                   Source="pack://application:,,,/WinwiseARDrone.SurfaceV1Client;component/Assets/EmergencyResetYes.png" />
                                            <Image x:Name="StateImagePressed" 
                                                   Visibility="Collapsed"
                                                   Width="42"
                                                   Height="42"
                                                   Source="pack://application:,,,/WinwiseARDrone.SurfaceV1Client;component/Assets/EmergencyResetYesTouch.png" />
                                        </Grid>
                                        <ControlTemplate.Triggers>
                                            <Trigger Property="ToggleButton.IsPressed" Value="True">
                                                <Setter TargetName="StateImageNormal" Property="Visibility" Value="Collapsed"/>
                                                <Setter TargetName="StateImagePressed" Property="Visibility" Value="Visible"/>
                                            </Trigger>
                                        </ControlTemplate.Triggers>
                                    </ControlTemplate>
                                </s:SurfaceButton.Template>
                            </s:SurfaceButton>

                            <!-- Bouton Non-->

                            <s:SurfaceButton x:Name="PART_btnHide"
                                             VerticalAlignment="Bottom"
                                             HorizontalAlignment="Right"
                                             Margin="0,0,5,0">
                                <s:SurfaceButton.Template>
                                    <ControlTemplate>
                                        <Grid Width="80"
                                              Height="80">
                                            <Image x:Name="StateImageNormal" 
                                                   Width="42"
                                                   Height="42"
                                                   Source="pack://application:,,,/WinwiseARDrone.SurfaceV1Client;component/Assets/EmergencyResetNo.png" />
                                            <Image x:Name="StateImagePressed" 
                                                   Visibility="Collapsed"
                                                   Width="42"
                                                   Height="42"
                                                   Source="pack://application:,,,/WinwiseARDrone.SurfaceV1Client;component/Assets/EmergencyResetNoTouch.png" />
                                        </Grid>
                                        <ControlTemplate.Triggers>
                                            <Trigger Property="ToggleButton.IsPressed" Value="True">
                                                <Setter TargetName="StateImageNormal" Property="Visibility" Value="Collapsed"/>
                                                <Setter TargetName="StateImagePressed" Property="Visibility" Value="Visible"/>
                                            </Trigger>
                                        </ControlTemplate.Triggers>
                                    </ControlTemplate>
                                </s:SurfaceButton.Template>
                            </s:SurfaceButton>

                        </Grid>

                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>